package com.how2java.tmall.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.how2java.tmall.mapper.CategoryMapper;
import com.how2java.tmall.pojo.Category;
import com.how2java.tmall.service.CategoryService;

@Service
public class CategoryServiceImpl implements CategoryService{
	@Autowired
	private CategoryMapper dao;
	
	@Override
	public List<Category> list() {
		
		
		return dao.list();
	}

	@Override
	public int total() {
		return dao.total();
	}

	@Override
	public void add(Category category) {
		dao.add(category);
	}

	@Override
	public void delete(Integer id) {
		dao.deleteByPrimaryKey(id);
	}

	@Override
	public Category get(int id) {
		return dao.selectByPrimaryKey(id);
	}

	@Override
	public void update(Category c) {
		dao.updateByPrimaryKeySelective(c);
	}

}
